package com.company.modules.project.util;

import com.company.modules.project.entity.Employee;
import org.springframework.stereotype.Component;

/**
 * @author Song, Wei
 * Date: 2022/3/21 12:09
 */
@Component
public class HostHolder {

    private final ThreadLocal<Employee> employees = new ThreadLocal<>();

    public void setEmployee(Employee employee) {
        employees.set(employee);
    }

    public Employee getEmployee() {
        return employees.get();
    }

    public void removeEmployee() {
        employees.remove();
    }

}
